angular.module('searchApp', [])
    .controller('searchCtrl', ['$scope', '$location', function ($scope, $location) {
        $scope.search = '';
        $scope.searchFn = function () {
            if ($scope.search) {
                $location.path('/book_fantasy').search({
                    title: $scope.search
                });
            }
        }
    }]);